package cn.mw.cmdb.entity;

import cn.mw.cmdb.param.ModelPropertyParam;
import cn.mw.components.mongodb.anno.CMDBProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.apache.commons.collections.map.ListOrderedMap;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.List;
import java.util.Map;

@Data
@Document("mw_cmdbmd_property_sort")
public class ModelPropertySortInfo {
    public static final String CustomMap = "customInfo";

    @Schema(description = "模型id")
    @CMDBProperty
    private String modelId;

    @Schema(description = "属性Id")
    @CMDBProperty
    private List<String> propertyIds;

    //自定义属性,如果需要获取包含父级的属性,需要通过getPropertyInfo方法
    @Schema(description = "模型属性信息,参照属性添加接口")
    @CMDBProperty(CustomMap)
    protected Map<String, ModelCustomPropertySettingInfo> customInfo = new ListOrderedMap();

    @Transient
    private List<ModelPropertyParam> propertyList;
}
